package com.zj.leetcode.easy.binarySearch;

/**
 * @program: algorithm
 * @description: 猜数字大小
 * 374 guess-number-higher-or-lower
 * @author: Zhang Bo
 * @create: 2022-04-19 10:14:45
 **/
public class GuessNumberHigherOrLower {
    public static void main(String[] args) {
        Solution solution = new GuessNumberHigherOrLower().new Solution();
        System.out.println(1 / 2);
    }
    //leetcode submit region begin(Prohibit modification and deletion)

    /**
     * Forward declaration of guess API.
     *
     * param n your guess
     * @return -1 if num is lower than the guess number
     * 1 if num is higher than the guess number
     * otherwise return 0
     * int guess(int num);
     */

    public class Solution {

        /**
         * 二分
         * @param n
         * @return
         */
        public int guessNumber(int n) {

//            int flag = this.guess(n);
//            int mid = n;
//            int l = 0;
//            int r = n;
//            while (flag != 0) {
//                mid = (r - l) / 2 + l;
//                flag = this.guess(mid);
//
//                if (flag > 0) {
//                    l = mid;
//                }
//                if (flag < 0) {
//                    r = mid;
//                }
//
//            }
//            return mid;
            return 0;
        }
    }
//leetcode submit region end(Prohibit modification and deletion)

}